<?php

use think\migration\Migrator;
use think\migration\db\Column;

class AlterCouponOrderAddProductIdAndBrandId extends Migrator
{
    public function up()
    {
        $this->table('coupon_order')
            ->addColumn('brand_id', 'integer', ['limit' => 15, 'default' => 0, 'comment' => '品牌id'])//在user表中增加一个test字段
            ->addColumn('product_id', 'integer', ['limit' => 15, 'default' => 0, 'comment' => '产品id'])//在user表中增加一个test字段
            ->update();
    }

    public function down()
    {
        $this->table('coupon_order')
            ->removeColumn('brand_id')
            ->removeColumn('product_id')
            ->update();
    }
}
